<?php
/**
 * Sale+sale_detail+Product ViewModel
 *
 * @author Mike Gao
 */
class SaleProductViewModel extends ViewModel{
    protected $pk  = 'Sale.id';

    public $viewFields = array(
    	'Sale' => array('*'),
        
        //'Warehouse' => array('name'=>'wname', '_on' => 'Sale.warehouse_id = Warehouse.id'),
        //'Customer' => array('name'=>'customer', '_on' => 'Sale.customer_id = Customer.id'),
        'Sale_detail' => array('id'=>'did','number', 'price','product_id','out_number','sale_title','total'=>'dtotal','create_time'=>'dctime','sale_title','_on' => 'Sale.id = Sale_detail.sale_id'),
        'Product' => array('id'=>'pid', 'name', 'tm','unit_id','cat_id','cost_default','_on' => 'Sale_detail.product_id = Product.id'),
        
    );


}
?>
